class Solution {
public:
    string restoreString(string s, vector<int>& indices) {
        char arr[101];
        for (int i = 0; i < indices.size(); i++) {
            arr[indices[i]] = s[i];
        }
        string a;
        for (int i = 0; i < indices.size(); i++) {
            a += arr[i];
        }
        return a;
    }
};